home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / printpa.com / PRINTPAS.DOC < prev    next >
Encoding:
Text File  |  1990-09-05  |  12.2 KB  |  249 lines

  1.                                                       10 July 90
  2.             TURBO PASCAL MODULATING PRINTING UTILITY
  3.  
  4. The Turbo Pascal Printing Utility is designed to improve the readability
  5. and usefulness of printed Turbo Pascal (TP) source code. This is done
  6. by utilizing the printing commands available on most dot matrix printers
  7. commonly used with PC's. The source code file is not affected in any way,
  8. although an additional file may be created, stripped of comments, if you
  9. choose. The program may be run from a command line or you may be prompted
  10. by the program. Printing output is through the lpt1 parallel port.
  11. To properly use this printing filter (TPMPU), a few guidelines must be fol-
  12. lowed in writing source code. These guidelines will be highlighted as the
  13. operation of TPMPU is outlined below. TPMPU assumes normal pascal syntax.
  14.  
  15. Using the Command Line Input With Switches ("/"):
  16. After typing TPMPU's filename, you may list the filename to be processed
  17. with any necessary path preceeding it in dos format. If the filename excludes
  18. a period and extension, ".pas" will be assumed. Other parameters may be
  19. added as desired, separated by spaces (or tabs). To change a later parameter,
  20. the earlier ones must be listed. The parameter order is:
  21.           a)path with filename
  22.           b)printer number (default to Epson FX="1")
  23.              choices: 1: Epson FX
  24.                       2: Epson MX
  25.                       3: IBM Proprinter
  26.                       4: Panasonic 1080/1090...
  27.                       5: Okidata 192/193
  28.  
  29.           c)create comment stripped file  (default is no creation="0")
  30.              choices: 0: no creation
  31.                       1: delete (* *)
  32.                       2: delete { }
  33.                       3: delete both
  34.  
  35.           d)modify global var before main program  (default is yes="1")
  36.              choices: 0: no printing modification
  37.                       1: printing modification
  38.  
  39. Set your printer to "top of form" before starting TPMPU.
  40.  
  41. Example: prntpas  /b:\pascal\testprog  /3 /0 /1
  42. TPMPU's executable filename is prntpas, it is located on drive "b" in sub-
  43. directory "pascal\". The program to print is testprog (.pas) and is to be
  44. printed with printer type #3. No comment stripped file is created and global
  45. variables are modified throughtout the source code.
  46.  
  47. Using Prompt Input:
  48. To become familiar with TPMPU, just type its filename, it will ask you
  49. for inputs, displaying values to be used on the command line when desired.
  50. Set your printer to "top of form" before entering printer type.
  51. If TPMPU can't find source code file, you will be reprompted for input.
  52.  
  53. TPMPU Operation:
  54. After getting preliminary information from the user, through a command line
  55. or by prompting, the pascal source code file is retrieved and the printer is
  56. initialized. Printing is started with a heading of the current date/time.Then
  57. the filename is printed with its directory listing of date/time.
  58. The key word "PROGRAM" or "UNIT" (all upper case) is searched for in the
  59. first 50 lines of text. If found, the phrase after it will be printed with
  60. emphasis. If the program is a pascal unit, then you will be prompted for
  61. whether You want to mark all procedures/functions or just external ones.
  62. TPMPU next starts processing the code for procedure and function
  63. names, until the body of the main program begins. The comment {main program}
  64. or {MAIN PROGRAM} should be written at the "begin" of the main program. If
  65. the source code is a pascal unit, then place this comment on the line with
  66. "implementation".
  67. Note there is only one space between the comment brackets and that is between
  68. the two words.
  69.  
  70.     ***********INCLUDE "{MAIN PROGRAM}" or "{main program}" at***********
  71.             *********BEGIN of the MAIN PROGRAM BODY************
  72.          ********or if a PASCAL UNIT, at "IMPLEMENTATION"*********
  73.  
  74. All procedure/function declarations must start with the upper case word
  75. "PROCEDURE" or "FUNCTION".
  76.  
  77.    *********USE "PROCEDURE" or "FUNCTION" in DECLARING THEM**********
  78.  
  79. After collecting these identifiers, the program starts from the begin-
  80. ning to print the source code, emphasizing+underlining the procedure/
  81. function names. The index number of the name will be printed as a com-
  82. ment on the right edge.It also looks for variables local to these pro-
  83. cedures/functions. The printing of these variables are modulated (us-
  84. ually italics) in the body of the procedure/function they exist in.
  85. In the declaration of them, there must be the word "var" or "Var" on
  86. a separate line (comments excepted) before any local variables are listed.
  87.  
  88.     ********DECLARE LOCAL VARIABLES WITH "Var" or "var" on a***********
  89.        *********SEPARATE LINE BEFORE LISTING IDENTIFIERS***********
  90.  
  91. Global variables must be declared with the word "VAR" on a separate line
  92. (comments excepted) before any variables are listed.
  93.  
  94.         ********DECLARE GLOBAL VARIABLES WITH "VAR" on a***********
  95.        *********SEPARATE LINE BEFORE LISTING IDENTIFIERS***********
  96.  
  97. Global variables will be printed in double strike form in the main program.
  98. If you choose, they will not be highlighted in the procedures and functions
  99. (the default is to highlight them throughout the source code).
  100.  
  101. TPMPU will keep a tally of "begin" and "end" on the right margin, looking
  102. for the words "begin", "Begin", "BEGIN", "end", "End", and "END". By tallying
  103. with "begins" adding and "ends" substracting from an index, you can more
  104. easily decipher the compound sentence logic in your code. All procedures/
  105. functions should begin/end with an index of one.
  106.  
  107.        ********USE LOWER ONLY, UPPER ONLY, or FIRST LETTER ONLY********
  108.               *******UPPER CASE for "BEGIN" and "END"********
  109.  
  110. Special case on tallying begins and ends:
  111. A few TP words have implicit "begin" and an explicit "end". Tallying is
  112. done as if both were explicit. When using the "case of" statement, both
  113. these words must be written on the same line for TPMPU to sense an implicit
  114. "begin".
  115.            *******"Case of" must appear on the same line********
  116.  
  117. After printing the source code, TPMPU will print a listing of procedures
  118. and functions detected in source code with index numbers. If the code
  119. is written with only uppercase "procedure" and "function" in declar-
  120. ations, then you can use the find-string feature of TP and the index numbers
  121. of this listing to easily move about your code while working in TP editor.
  122.  
  123. TPMPU will compress printing of comments, of type "{ }" and "(* *)".  The
  124. former will be printed at 12 or 15 cpi if your printer supports this (other-
  125. wise it will be printed at 17 cpi). The latter will be printed at 17 cpi.
  126. You may request that a source code disk file be created of your code strip-
  127. ped of one or both of these code forms. Using "(* *)" for your skipped code
  128. and "{ }" for programmer comments will enable you to conveniently strip off
  129. one and retain the other. If you have special 'in-house' comments, they
  130. may be enclosed in "(* *)" and stripped off with the code before the
  131. code is 'released'.
  132.  
  133. To clarify TPMPU's operation, a short "nonsense" pascal program is included
  134. to print using TPMPU.
  135.  
  136. Errors:
  137. a) If more procedures & functions are detected than can be listed, a
  138. comment will be displayed. You will be prompted to print the code anyway
  139. or quit.
  140. b) If there seems to be an error in the "begin-end" count, this will be
  141. displayed. Typically this happens when a procedure/function does not start
  142. with a count of 1.
  143.   NOTE:In processing pascal units, because "implementation" has an
  144.   implicit "begin", procedure/functions will start with a count of 2.
  145.   To avoid erroneous error comments, you can write "implementation" to
  146.   avoid detection (ex. implementatioN, ImplementatioN).
  147.  
  148. Registration:
  149.  
  150. You are free to use TPMPU for up to a month before you should register.
  151. You are free to make copies and distribute it in combination with accompanying
  152. documentation.
  153.  
  154. The cost is $15 plus $1 for shipping.
  155.  
  156. By registering, you will receive:
  157.  
  158. a) The current updated version of TPMPU plus information on constructing
  159. your personalized printer command files for use by TPMPU. To help you
  160. work out command files for your printer, to produce personally tailored
  161. printing results, a test program (with source code) will be included.
  162. For convenience, you may request the default printer type be other than
  163. Epson FX.
  164.  
  165. b) For the registered program, the max # of procedures and functions that
  166. may be detected is = 80. (The unregistered program is 20.) If desired, you
  167. may request another max value.
  168.  
  169. c) A second updated version will have a default to printer type "8", for
  170. use with an external CMD file.
  171.  
  172. d) Both updated, registered versions of TPMPU will include the  provision to
  173. divert the modulated printing text to a disk file. Diverting the printing
  174. text will greatly speed up the program's operation and enable you to use
  175. "print.com" in DOS, a crude but functional 'time-share' utility. As you
  176. probably know by now, printing a long text file on a dot matrix printer can
  177. take a while. Since the running time for TPMPU is limited by how fast your
  178. printer can print output, putting the output to a disk file makes TPMPU
  179. run much faster. By using "print" in DOS, you can get your printed output
  180. of modulated source code while doing other work on your PC.
  181.  
  182. e) Registered versions of TPMPU include a provision to print out only
  183. the procedure/function table with indices. I often use this table to
  184. maneuver around a large source code program with the help of "search" in
  185. the TP editor.
  186.  
  187. f) As a registered owner you also have the privilege of receiving program
  188. support. I can be reached at the address below.
  189.  
  190. g) As a registered owner, you may request modifications to TPMPU to meet
  191. special needs and styles. The cost for such modifications naturally depends
  192. on how much reworking is necessary. In replying to such requests, I will
  193. state the cost and time estimate for doing the modifications.
  194.  
  195. My address for registration and support is:
  196.  
  197.                  Dennis DiBart
  198.                  747 Elm St.
  199.                  El Cerrito, Ca. 94530
  200.  
  201.  
  202.  
  203.          ----------------end-of-author's-documentation---------------
  204.  
  205.                          Software Library Information:
  206.  
  207.                     This disk copy provided as a service of
  208.  
  209.                            Public (software) Library
  210.  
  211.          We are not the authors of this program, nor are we associated
  212.          with the author in any way other than as a distributor of the
  213.          program in accordance with the author's terms of distribution.
  214.  
  215.          Please direct shareware payments and specific questions about
  216.          this program to the author of the program, whose name appears
  217.          elsewhere in  this documentation. If you have trouble getting
  218.          in touch with the author,  we will do whatever we can to help
  219.          you with your questions. All programs have been tested and do
  220.          run.  To report problems,  please use the form that is in the
  221.          file PROBLEM.DOC on many of our disks or in other written for-
  222.          mat with screen printouts, if possible.  PsL cannot debug pro-
  223.          programs over the telephone, though we can answer questions.
  224.  
  225.          Disks in the PsL are updated  monthly,  so if you did not get
  226.          this disk directly from the PsL, you should be aware that the
  227.          files in this set may no longer be the current versions. Also,
  228.          if you got this disk from another vendor and are having prob-
  229.          lems,  be aware that  some files may have become corrupted or
  230.          lost by that vendor. Get a current, working disk from PsL.
  231.  
  232.          For a copy of the latest monthly software library newsletter
  233.          and a list of the 2,000+ disks in the library, call or write
  234.  
  235.                            Public (software) Library
  236.                                P.O.Box 35705 - F
  237.                             Houston, TX 77235-5705
  238.  
  239.                                 1-800-2424-PSL
  240.                                  MC/Visa/AmEx
  241.  
  242.                           Outside of U.S. or in Texas
  243.                           or for general information,
  244.                               Call 1-713-524-6394
  245.  
  246.                           PsL also has an outstanding
  247.                           catalog for the Macintosh.
  248.  
  249.